﻿
using LYR_RPA.models.entity;
using LYR_RPA.models.view;
using LYR_RPA.service;
using LYR_RPA.utils;
using System;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;


namespace LYR_RPA.views.ui
{
    /// <summary>
    /// HomeWindow.xaml 的交互逻辑
    /// </summary>
    public partial class HomeWindow : Window
    {
        
        private readonly WebSocketClient WebSocketClient;
        public HomeWindow()
        {
            InitializeComponent();
            
            WebSocketClient = WebSocketClient.Instance;
        }
         
        private void Window_StateChanged(object sender, EventArgs e)
        {
            if (this.WindowState == WindowState.Minimized)
            {
                this.Hide();
            }
        }

        /*
         * 窗口移动
         */
        private void Card_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                DragMove();
            }
        }
        /*
         * 窗口最小化
         */
        private void Button_Minimize(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Minimized;
        }

        /*
         * 关闭窗口并结束程序
         */
        private void Button_Close(object sender, RoutedEventArgs e)
        {
            this.Hide();
        }
        /*
         * 最大化
         */
        private void Button_Maximize(object sender, RoutedEventArgs e)
        {
            
            if (WindowState == WindowState.Maximized)
            {
                WindowState = WindowState.Normal;
                Max_Icon.Kind = MaterialDesignThemes.Wpf.PackIconKind.WindowMaximize;
            }
            else
            {
                Max_Icon.Kind = MaterialDesignThemes.Wpf.PackIconKind.DockWindow;
                WindowState = WindowState.Maximized;
            }
        }
    }
}
